//
//  UITextField+Placeholder.m
//  BuDeJie
//
//  Copyright © 2016年 小码哥. All rights reserved.
//

#import "UITextField+Placeholder.h"

@implementation UITextField (Placeholder)

// 设置占位文字颜色
- (void)setPlaceholderColor:(UIColor *)placeholderColor
{
    if (self.placeholder == nil) {
        self.placeholder = @" ";
    }
    
    // 获取占位文字控件
    UILabel *placeholderLabel = [self valueForKey:@"placeholderLabel"];
    
    // 拿到控件去设置颜色
    placeholderLabel.textColor = placeholderColor;

}

// 返回占位文字颜色
- (UIColor *)placeholderColor
{
    return nil;
}
@end
